import { createRouter, createWebHashHistory } from "vue-router";
import chat from "../views/chat.vue";
import home from "../views/home.vue";
import launchpad from "../views/launchpad.vue";
import page from "../views/index.vue";
import trading from "../views/trading.vue";
import search from "../views/search.vue";
import trade from "../views/trade.vue";
import exchange from "../views/exchange.vue";
import contract from "../views/contract.vue";
import view from "../views/view.vue";
import node from "../views/node.vue";
import account from "../views/account.vue";
import invitation from "../views/invitation.vue";
import mine from "../views/mine.vue";
import transfer from "../views/transfer.vue";
import transferout  from "../views/transferout.vue";
import rewards from "../views/rewards.vue";
import logs2 from '../views/logs2.vue'
import orders from '../views/orders.vue'
import transferLogs from '../views/transferLogs.vue'
import transferoutLogs from '../views/transferoutLogs.vue'
import coin from '../views/coin.vue'
import pools from '../views/pools.vue'

const routes = [
  {
    path: "/",
    redirect: "/page",
    children: [
      {
        path: "page",
        name: "page",
        component: page,
        redirect: "/page/home",
        children: [
          {
            path: "chat",
            name: "chat",
            component: chat,
          },
          {
            path: "home",
            name: "home",
            component: home,
          },
          {
            path: "trading",
            name: "trading",
            component: trading,
          },
          {
            path: "account",
            name: "account",
            component: account,
          },
          {
            path: "pools",
            name: "pools",
            component: pools,
          },
          {
            path: "trade",
            name: "trade",
            component: trade,
            redirect: "/page/trade/exchange",
            children:[
              {
                path: "exchange",
                name: "exchange",
                component: exchange,
              },
              {
                path: "contract",
                name: "contract",
                component: contract,
              },
            ]
          },
        ],
      },
    ],
  },
  {
    path: "/launchpad",
    name: "launchpad",
    component: launchpad,
  },
  {
    path: "/search",
    name: "search",
    component: search,
  },
  {
    path: "/view",
    name: "view",
    component: view,
  },
  {
    path: "/node",
    name: "node",
    component: node,
  },
  {
    path: "/invitation",
    name: "invitation",
    component: invitation,
  },
  {
    path: "/mine",
    name: "mine",
    component: mine,
  },
  {
    path: "/transfer",
    name: "transfer",
    component: transfer,
  },
  {
    path: "/transfer/logs",
    name: "transferLogs",
    component: transferLogs,
  },
  {
    path: "/transferout",
    name: "transferout",
    component: transferout,
  },
  {
    path: "/transferout/logs",
    name: "transferoutLogs",
    component: transferoutLogs,
  },
  {
    path: "/rewards",
    name: "rewards",
    component: rewards,
  },
  {
    path: "/logs2",
    name: "logs2",
    component: logs2,
  },
  {
    path: "/orders",
    name: "orders",
    component: orders,
  },
  {
    path: "/coin",
    name: "coin",
    component: coin,
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
